<!-- 固定悬浮窗-样式 -->
<template>
    <el-collapse modelValue="1">
        <el-collapse-item title="组件风格" name="1">
            <el-row>
                <el-col :span="9" :offset="1">
                    <div :class="{ 'native': mode === 0 }" class="suspension-mode" @click="mode = 0">
                        <div class="item-content mode0">
                            <div class="item-content-li"></div>
                            <div class="item-content-li"></div>
                            <div class="item-content-li"></div>
                        </div>
                        <div class="title-mark">竖版</div>
                    </div>
                </el-col>
                <el-col :span="9" :offset="1">
                    <div :class="{ 'native': mode === 1 }" class="suspension-mode" @click="mode = 1">
                        <div class="item-content mode1">
                            <div class="item-content-li"></div>
                            <div class="item-content-li"></div>
                            <div class="item-content-li"></div>
                        </div>
                        <div class="title-mark">横版</div>
                    </div>
                </el-col>
            </el-row>
        </el-collapse-item>
    </el-collapse>
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
export default defineComponent({
    name: 'SuspensionType',
    props: {
        widget: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { widget } = toRefs(props)

        const mode = computed({
            get: () => widget.value.widgetData.eles.customFeature.mode,
            set: val => widget.value.widgetData.eles.customFeature.mode = val
        })

        return {
            widget,
            mode
        }
    }
})
</script>

<style lang="less" scoped>
.suspension-mode {
    display: inline-block;
    width: 75px;
    height: 75px;
    border: 1px solid var(--edit-border-color-darker);
    padding: 5px;
    box-sizing: border-box;
    cursor: pointer;
    &.native {
        border-color: var(--edit-color-primary);
    }
    .item-content {
        width: 100%;
        height: 100%;
        background-color: var(--edit-border-color);
        &.mode0 {
            .item-content-li {
                width: 19px;
                height: 19px;
                background-color: var(--edit-text-color-disabled);
                margin: 0 auto;
                margin-bottom: 3px;
                &:last-child {
                    margin-bottom: 0;
                }
            }
        }
        &.mode1 {
            line-height: 75px;
            .item-content-li {
                display: inline-block;
                width: 19px;
                height: 19px;
                background-color: var(--edit-text-color-disabled);
                margin-right: 3px;
                &:last-child {
                    margin-right: 0;
                }
            }
        }
    }
    .title-mark {
        text-align: center;
        margin-top: 10px;
    }
}
</style>